
#include "gui2.h"
#include "oled.h"
#include "bike.h"
#include "button.h"
#include "stepper.h"
#include "icons.h"

unsigned char currentMode = 3;

MenuItem mainMenuItems[9] = {
                                { 
                                    {
                                        { 0 },
                                        { 2, 2, 40, 40, big_button_selected },
                                        { 7, 5, 30, 33, shock },
                                        0
                                    },
                                    0,    
                                    &sagCfgHandler,
                                    &modeSubMenu
                                },
                                {
                                    {
                                        { 50, 7, YELLOW, BLUE, BORDER_BLUE, "STAT", 4},
                                        { 44, 2, 40, 40, big_button_unselected },
                                        { 50, 22, 27, 15, bike },
                                        0
                                    },
                                    0,    
                                    &statHandler,
                                    &modeSubMenu
                                },
                                { 
                                    {
                                        { 0 },
                                        { 86, 2, 40, 40, big_button_unselected },
                                        { 96, 9, 24, 27, off_button },
                                        0
                                    },
                                    0,    
                                    &shutDownHandler,
                                    0
                                },
                                { 
                                    {
                                        { 0 },
                                        { 2, 56, 40, 34, mode_button_highlighted_unselected },
                                        { 6, 66, 32, 14, xc_sel },
                                        1
                                    },
                                    1,    
                                    &modeCfgHandler,
                                    &modeSubMenu
                                },
                                { 
                                    {
                                        { 0 },
                                        { 44, 56, 40, 34, mode_button_unhighlighted_unselected },
                                        { 49, 66, 30, 14, am },
                                        1
                                    },
                                    0,    
                                    &modeCfgHandler,
                                    &modeSubMenu
                                },
                                { 
                                    {
                                        { 0 },
                                        { 86, 56, 40, 34, mode_button_unhighlighted_unselected },
                                        { 91, 66, 31, 14, dh },
                                        1
                                    },
                                    0,    
                                    &modeCfgHandler,
                                    &modeSubMenu
                                },
                                { 
                                    {
                                        { 0 },
                                        { 20, 93, 40, 34, mode_button_unhighlighted_unselected },
                                        { 25, 103, 30, 14, rd },
                                        1
                                    },
                                    0,    
                                    &modeCfgHandler,
                                    &modeSubMenu
                                },
                                { 
                                    {
                                        { 0 },
                                        { 62, 93, 40, 34, mode_button_unhighlighted_unselected },
                                        { 67, 103, 30, 14, rc },
                                        1
                                    },
                                    0,    
                                    &modeCfgHandler,
                                    &modeSubMenu
                                },
                            };

Menu mainMenu = {
                    mainMenuItems,
                    0,
                    { 
                   // UP  DN L  R
                      {0 ,3, 0, 1},
                      {1 ,4, 0, 2},
                      {2 ,5, 1, 2},
                      {0 ,6, 3, 4},
                      {1 ,6, 3, 5},
                      {2 ,7, 4, 5},
                      {3 ,6, 6, 7},
                      {5 ,7, 6, 7}
                    }
                };    
